package api

import (
	"alipay/api/handler/handler"
	jwt2 "alipay/pkg"
	"github.com/gin-gonic/gin"
)

func User(r *gin.Engine) {
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.Register)
			user.POST("login", handler.Login)
		}
		order := api.Group("/order")
		{
			order.Use(jwt2.JWTAuth("2211a"))
			order.POST("create", handler.CreateOrder)
			order.POST("find", handler.FindOrder)
			order.POST("finds", handler.FindsOrder)
		}
	}
}
